<?php
class friendlistdao extends daobase {
	public function getMyFriends($userId,$kind){
		$sql = "select * from informationbook where user_id = '$userId'";
		if ($kind!=""){
			$kindId = $this->getKindId($kind);
			$sql .=" and kind_id = '$kindId'";
		}
		$sql .=" order by id asc";
		$friends = $this->fetchit($sql);
		return $friends;
	}
	public function getKindName($kind_id){
		$sql = "select class_name from friend_class where id = '$kind_id'";
		$name = $this->fetchit($sql);
		$kindName = $name[0][0];
		return $kindName;
	}
	public function getKindId($kind){
		$sql = "select id from friend_class where class_name = '$kind'";
		$id = $this->fetchit($sql);
		$id = $id[0][0];
		return $id;
	}
	public function deleteIterm($id){
		$sql = "delete from informationbook where id = '$id'";
		$delete = $this->queryit($sql);
		return $delete;
	}
	 
}
?>